<!DOCTYPE html>
<html>
	<head>
		<title>Tooltips - advanced initialization</title>
		<link rel="stylesheet" href="../../../codebase/webix.css" type="text/css" charset="utf-8">
		<script src="../../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>

		<link rel="stylesheet" type="text/css" href="../common/samples.css">
		<script src="../common/testdata.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class='header_comment'>Tooltips</div>
		<div class='sample_comment'>Tooltip can be defined as function</div>
		<div id="testA"></div>
		<script type="text/javascript" charset="utf-8">

		function mytip(obj, common){
			var column = common.column.id;
			if (column == "rank") return "Not real";
			return obj[column];
		};

		webix.ready(function(){
			grid = webix.ui({
				container:"testA",
				view:"datatable",
				columns:[
					{ id:"rank",  tooltip:mytip, width:50, header:"", css:"rank" },
					{ id:"title", tooltip:mytip, width:200, header:"Film title" },
					{ id:"year",  tooltip:mytip, header:"Year"},
					{ id:"votes", tooltip:mytip, header:"Votes"}
				],
				tooltip:true,
				autoheight:true,
				autowidth:true,

				data:small_film_set
			});	
		});
		</script>
	</body>
</html>